require(["jquery","bbcare","scprit/department/view/template/follow-up/common.js"],function($,$bb,$common) {
	'use strict';
	var URL = $bb.baseUrl("department")+"followup/service";
	var obj=$bb.getPageParams();
	var userId=obj.babyId;
	var type=obj.type;//历史记录传参；
	if(obj.doctorName && obj.createTime){
		$("#checkTime").html(obj.createTime);
		$("#checkName").html(obj.doctorName);
	}else{
		var account=eval('('+sessionStorage.account+')');
		var accountName=account.alias;
		$("#checkTime").html($common.getNowFormatDate());
		$("#checkName").html(accountName);
	}
	getBabyInfo();
	var data = JSON.parse(localStorage.getItem("smallWechsler"));
	$.each(data, function(id,value) {
		if(id=="语言量表分") $("#a1").html("<p>"+value+"</p>");
		if(id=="语言智商") $("#a2").html("<p>"+value+"</p>");
		if(id=="操作量表分") $("#b1").html("<p>"+value+"</p>");
		if(id=="操作智商") $("#b2").html("<p>"+value+"</p>");
		if(id=="总量表分") $("#c1").html("<p>"+value+"</p>");
		if(id=="总智商") $("#c2").html("<p>"+value+"</p>");
	});
	function getBabyInfo() {
		$bb.ajax({
			url: URL + "/patient/patientInfoPtId",
			data: JSON.stringify({
				data: {
					"patientId": userId
				}
			}),
			success: function(data){
				if(data.success) {
					var babyInfo=data.data.PatientInfo;
					var gender= (babyInfo.gender=="N")? "男":"女";
					var babyData=$common.babyInfoDeal(babyInfo);
					$common.infoInit({"id":"#babyInfoList","data":babyData});
					var reportTime = obj.createTime ? obj.createTime : $common.getNowFormatDate();
					var date1 = new Date(reportTime);  //开始时间
				}
			}
		});
	}
})


